package main

import java.util.*

fun main() {
    val mood = "hello,world"

    run {
        val mood = "hello,china"
        println(mood)
    }
    println(mood)
}

fun randomDay(): String {
    val weekList = listOf<String>("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday")
    return weekList[Random().nextInt(7)]
}

//lambda表达式
var dirty = 20
val waterFilter: (Int) -> Int = { dirty -> dirty / 2 }
fun feedFish(dirty: Int) = dirty + 10
fun updateDirty(dirty: Int, operation: (Int) -> Int): Int {
    return operation(dirty)
}

fun dirtyProcessor() {
    dirty = updateDirty(dirty, waterFilter)
    dirty = updateDirty(dirty, ::feedFish)
    dirty = updateDirty(dirty) { dirty -> dirty + 50 }
}

class Man{

}

fun testGetClass(){
    val man=Man()
    val kClass = man::class
    val java = man::class.java
}